package BIll;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import Dao.DAOUser;

import Entity.User;

import tool.DaoFactory;

public class BLLUser extends BLLAbstract{
	private DaoFactory daoFactory = DaoFactory.getDaoFactory();
	private DAOUser daoUser = daoFactory.getInstance(DAOUser.class);
	
	
	public boolean addUser(String name,String idcard,int phone){
		User user = new User();
		user.setName(name);
		user.setIdcard(idcard);
		user.setPhone(phone);
		user.setStatus(1);
		boolean b = daoUser.adduser(user);
		return true;
	}
	

	public Map<String, Object> queryUser(String name){
		Map<String, Object> map = daoUser.queryUser(name);
		return map;
	}
	
	public Map<String, Object> queryUserByIdcard(String idcard){
		Map<String, Object> map = daoUser.queryUserByIdcard(idcard);
		return map;
	}
	
	public boolean CheckOut(String idcard){
		boolean b = daoUser.checkOut(idcard);
		return b;
	}
}